﻿$(function () {
    //初始化控件
    laydate.render({ elem: '#txtmedicalTime', type: 'datetime' });
    laydate.render({ elem: '#txtfirstHTime', type: 'datetime' });
    laydate.render({ elem: '#txtgetbloodTime', type: 'datetime' });
    laydate.render({ elem: '#txtheadctTime', type: 'datetime' });
    laydate.render({ elem: '#txtheadxlineTime', type: 'datetime' });
    laydate.render({ elem: '#txtchestxlineTime', type: 'datetime' });
    laydate.render({ elem: '#txtecgTime', type: 'datetime' });
    laydate.render({ elem: '#txtBmodeTime', type: 'datetime' });
    laydate.render({ elem: '#txtdiagnosisOverTime', type: 'datetime' });
    laydate.render({ elem: '#txtarriveOpRoomTime', type: 'datetime' });
    laydate.render({ elem: '#txtanaesTime', type: 'datetime' });
    laydate.render({ elem: '#txtdmlssopTime', type: 'datetime' });
    laydate.render({ elem: '#txtdmlssopEndTime', type: 'datetime' });
    laydate.render({ elem: '#txtbreaklineTime', type: 'datetime' });
    laydate.render({ elem: '#txtlndmlexitPtime', type: 'datetime' });
    laydate.render({ elem: '#txtlndmldieTime', type: 'datetime' });
    laydate.render({ elem: '#txtXQCCTime', type: 'datetime' });
    laydate.render({ elem: '#txtFQCCTime', type: 'datetime' });
    laydate.render({ elem: '#txtsqsxTime', type: 'datetime' });
    laydate.render({ elem: '#txtkssxTime', type: 'datetime' });
    laydate.render({ elem: '#txtxxianTime', type: 'datetime' });
    laydate.render({ elem: '#txtCTTime', type: 'datetime' });
    laydate.render({ elem: '#txtqgcgTime', type: 'datetime', done: function (value, date, endDate) { datetimedone("txtqgcgTime") } });
    laydate.render({ elem: '#txtxqbsylTime', type: 'datetime', done: function (value, date, endDate) { datetimedone("txtxqbsylTime") } });
    laydate.render({ elem: '#txtbxTime', type: 'datetime', done: function (value, date, endDate) { datetimedone("txtbxTime") } });
    laydate.render({ elem: '#txtsxTime', type: 'datetime', done: function (value, date, endDate) { datetimedone("txtsxTime") } });
    laydate.render({ elem: '#txtjtgdTime', type: 'datetime', done: function (value, date, endDate) { datetimedone("txtjtgdTime") } });
    laydate.render({ elem: '#txtxdgdTime', type: 'datetime', done: function (value, date, endDate) { datetimedone("txtxdgdTime") } });
    laydate.render({ elem: '#txtgpgdTime', type: 'datetime', done: function (value, date, endDate) { datetimedone("txtgpgdTime") } });
    laydate.render({ elem: '#txtqysTime', type: 'datetime', done: function (value, date, endDate) { datetimedone("txtqysTime") } });
    laydate.render({ elem: '#txtlkqjsTime', type: 'datetime', done: function (value, date, endDate) { datetimedone("txtlkqjsTime") } });
    $("#txtqgcgTime,#txtxqbsylTime,#txtbxTime,#txtsxTime,#txtjtgdTime,#txtxdgdTime,#txtgpgdTime,#txtqysTime,#txtlkqjsTime").on("blur", function () {
        datetimedone($(this).attr("id"));
    });
    position();
    SetValue();
    $("#btnUpdate").on("click", function () { window.location.reload(true); });
    $("#btnSave").on("click", function () { savemr(); });
    $("#btnPrint").on("click", function () { printmr(); });
    $("#btnDel").on("click", function () { delmr(); });
    $("#btnHisback").on("click", function () { window.location.href = "/TraumaCenter/MedicalRecords/Index"; });
    $("#btnTimePath").on("click", function () { if (IsEmpty($("#txtPatientId").val())) return; window.location.href = "/TraumaCenter/MedicalRecords/Timepath?pid=" + $("#txtPatientId").val(); });
    $("#btnTimeLine").on("click", function () {
        if (IsEmpty($("#txtPatientId").val())) return;
        var url = "/TraumaCenter/Pathway/Index?id=" + $("#txtPatientId").val();
        window.parent.top.tab.addTabItem({ tabid: "time" + $("#txtPatientId").val(), text: "时间轴", url: url });
    });
    $(":text[typeof=float]").keyup(function () {
        var c = $(this);
        if (/[^\d|\.]/.test(c.val())) {
            var num = c.val().replace(/[^\d|\.]/g, '');
            $(this).val(num == "" ? "" : parseInt(num));
        }
    }).blur(function () {
        if (!/^\d+(\.\d{0,2})?$/.test($(this).val()))
            $(this).val("0.00");
    });
    $(":text[typeof=number]").keyup(function () {
        var c = $(this);
        if (/[^\d]/.test(c.val())) {
            var num = c.val().replace(/[^\d]/g, '');
            $(this).val(num == "" ? "" : parseInt(num));
        }
    }).blur(function () {
        if (!/\d+/.test($(this).val()))
            $(this).val("0");
    });
    $("#txtshenZhi").ligerComboBox({
        width: 130,
        data: [{ "ID": 0, "Name": "正常" }, { "ID": 3, "Name": "模糊或烦躁" }, { "ID": 5, "Name": "不可理解的言语" }],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'hdncomeType',
    });
    $("#txtchuantou").ligerComboBox({
        width: 60,
        data: [{ "ID": 0, "Name": "无" }, { "ID": 4, "Name": "有" }],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'ctncomeType',
    });
    $("#txtbuWei").ligerComboBox({
        width: 130,
        data: [{ "ID": 1, "Name": "四肢" }, { "ID": 3, "Name": "躯干背部" }, { "ID": 5, "Name": "胸腹部" }, { "ID": 6, "Name": "头颈部" }],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'bwType',
    });
    $("#txtChuangshang").ligerComboBox({
        width: 130,
        data: [{ "ID": 1, "Name": "撕裂伤" }, { "ID": 3, "Name": "刺伤" }, { "ID": 5, "Name": "钝挫伤" }, { "ID": 6, "Name": "弹道伤" }],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'csType',
    });
    $("#txtxunHuan").ligerComboBox({
        width: 195,
        data: [{ "ID": 1, "Name": "正常" }, { "ID": 3, "Name": "BP<60-100mmHg P>100次/分" }, { "ID": 5, "Name": "BP<60mmHg P>140次/分" }, { "ID": 6, "Name": "BP、脉搏测不到" }],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'xhType',
    });
    $("#txtyiShi").ligerComboBox({
        width: 130,
        data: [{ "ID": 1, "Name": "倦怠" }, { "ID": 3, "Name": "嗜睡" }, { "ID": 5, "Name": "浅昏迷" }, { "ID": 6, "Name": "深昏迷" }],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'ysType',
    });
    $("#txtHuxi").ligerComboBox({
        width: 130,
        data: [{ "ID": 1, "Name": "胸痛" }, { "ID": 3, "Name": "呼吸困难" }, { "ID": 5, "Name": "发绀" }, { "ID": 6, "Name": "无呼吸" }],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'hxType',
    });
    $("#txtHXFD").ligerComboBox({
        width: 130,
        data: [{ "ID": 0, "Name": "浅，困难" }, { "ID": 1, "Name": "正常" }],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'hxfdType',
    });
    $("#txtMXXGCY").ligerComboBox({
        width: 130,
        data: [{ "ID": 0, "Name": "无" }, { "ID": 1, "Name": "迟缓(<2s)" }, { "ID": 2, "Name": "正常(>2s)" }],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'mxxgType',
    });
    $("#txtzhenYan").ligerComboBox({
        width: 130,
        data: [{ "ID": 4, "Name": "正常睁眼" }, { "ID": 3, "Name": "呼唤睁眼" }, { "ID": 2, "Name": "刺痛睁眼" }, { "ID": 1, "Name": "无睁眼" }],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'zyncomeType',
    });
    $("#txtyanYu").ligerComboBox({
        width: 130,
        data: [{ "ID": 5, "Name": "回答正确" }, { "ID": 4, "Name": "回答错误" }, { "ID": 3, "Name": "言语错乱" }, { "ID": 2, "Name": "含糊不清" }, { "ID": 1, "Name": "无反应" }],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'yyncomeType',
    });
    $("#txtyunDong").ligerComboBox({
        width: 175,
        data: [{ "ID": 6, "Name": "按吩咐动作" }, { "ID": 5, "Name": "对疼痛刺激能定位" }, { "ID": 4, "Name": "对刺痛有躲避反应" }, { "ID": 3, "Name": "刺痛时肢体屈曲(去皮层状态)" }, { "ID": 2, "Name": "刺痛时肢体过伸 (去脑状态)" }, { "ID": 1, "Name": "无反应" }],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'ydncomeType',
    });
    $("#txttjb").ligerComboBox({
        width: 150,
        data:
            [
                { "ID": 1, "Name": "1分（轻度）" },
                { "ID": 2, "Name": "2分（中度）" },
                { "ID": 3, "Name": "3分（重度不危及生命）" },
                { "ID": 4, "Name": "4分（重度危及生命）" },
                { "ID": 5, "Name": "5分（危重或可成活）" },
                { "ID": 6, "Name": "6分（最大损伤）" }
            ],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'tjbType',
    });
    $("#txtxb").ligerComboBox({
        width: 150,
        data:
            [
                { "ID": 1, "Name": "1分（轻度）" },
                { "ID": 2, "Name": "2分（中度）" },
                { "ID": 3, "Name": "3分（重度不危及生命）" },
                { "ID": 4, "Name": "4分（重度危及生命）" },
                { "ID": 5, "Name": "5分（危重或可成活）" },
                { "ID": 6, "Name": "6分（最大损伤）" }
            ],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'xbType',
    });
    $("#txtmb").ligerComboBox({
        width: 150,
        data:
            [
                { "ID": 1, "Name": "1分（轻度）" },
                { "ID": 2, "Name": "2分（中度）" },
                { "ID": 3, "Name": "3分（重度不危及生命）" },
                { "ID": 4, "Name": "4分（重度危及生命）" },
                { "ID": 5, "Name": "5分（危重或可成活）" }
            ],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'mbType',
    });
    $("#txtfb").ligerComboBox({
        width: 150,
        data:
            [
                { "ID": 1, "Name": "1分（轻度）" },
                { "ID": 2, "Name": "2分（中度）" },
                { "ID": 3, "Name": "3分（重度不危及生命）" },
                { "ID": 4, "Name": "4分（重度危及生命）" },
                { "ID": 5, "Name": "5分（危重或可成活）" },
                { "ID": 6, "Name": "6分（最大损伤）" }
            ],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'fbType',
    });
    $("#txtsz").ligerComboBox({
        width: 150,
        data:
            [
                { "ID": 1, "Name": "1分（轻度）" },
                { "ID": 2, "Name": "2分（中度）" },
                { "ID": 3, "Name": "3分（重度不危及生命）" },
                { "ID": 4, "Name": "4分（重度危及生命）" },
                { "ID": 5, "Name": "5分（危重或可成活）" }
            ],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'szType',
    });
    $("#txttb").ligerComboBox({
        width: 150,
        data:
            [
                { "ID": 1, "Name": "1分（轻度）" },
                { "ID": 2, "Name": "2分（中度）" },
                { "ID": 3, "Name": "3分（重度不危及生命）" },
                { "ID": 4, "Name": "4分（重度危及生命）" },
                { "ID": 5, "Name": "5分（危重或可成活）" },
                { "ID": 6, "Name": "6分（最大损伤）" }
            ],
        isMultiSelect: false,
        valueField: "ID",
        textField: "Name",
        value: 0,
        valueFieldID: 'tbType',
    });
    //身份证判断
    $("#txtIDcard").on("blur", function () {
        var idCardRegex = /\d{17}[0-9Xx]|\d{15}/;
        $("#chkIsIDcard").removeAttr("checked");
        $(this).parent().removeClass("checked");
        if (!idCardRegex.test($(this).val())) return;
        $("#chkIsIDcard").attr("checked", "checked");
        $(this).parent().addClass("checked");
    });
    //港澳台证
    $("#txtGangAoTaiNum").on("blur", function () {
        var gangaoRegx = /^([A-Z]\d{6,10}(\(\w{1}\))?)$/;
        var taiwanRegx = /^\d{8}|^[a-zA-Z0-9]{10}|^\d{18}$/;
        $("chkIsGangAoTai").removeAttr("checked");
        $(this).parent().removeClass("checked");
        if (!(gangaoRegx.test($(this).val()) || taiwanRegx.test($(this).val()))) return;
        $("#chkIsGangAoTai").attr("checked", "checked");
        $(this).parent().addClass("checked");
    })
    //护照
    $("#txtHuZhao").on("blur", function () {
        var huzhaoRegx = /^([a-zA-z]|[0-9]){5,17}$/;
        $("#chkIsHuZhao").removeAttr("checked");
        $(this).parent().removeClass("checked");
        if (!huzhaoRegx.test($(this).val())) return;
        $("#chkIsHuZhao").attr("checked", "checked");
        $(this).parent().addClass("checked");
    })
    //计算BMI
    $("#txtpheigh,#txtpweight").on("blur", function () {
        var float2regex = /^\d+(\.\d{0,2})?$/;
        var height = $("#txtpheigh").val();
        var weight = $("#txtpweight").val();
        if (!float2regex.test(height)) return;
        if (!float2regex.test(weight)) return;
        if (parseInt(height) == 0) return;
        //计算BMI
        var height2 = parseInt(height) / 100;
        var bmiVal = (parseFloat(weight) / (height2 * height2)).toFixed(2);
        $("#txtbmiVal").val(bmiVal);

    });
    //计算map
    $("#txtpssyVal,#txtpszyVal").on("blur", function () {
        var float2regex = /^\d+(\.\d{0,2})?$/;
        var pssyVal = $("#txtpssyVal").val();
        var pszyVal = $("#txtpszyVal").val();
        if (!float2regex.test(pssyVal)) return;
        if (!float2regex.test(pszyVal)) return;
        //计算map
        var ssy = parseFloat(pssyVal);
        var szy = parseFloat(pszyVal);
        if (ssy == 0 && szy == 0) return;
        var mapVal = ((ssy + szy * 2) / 3).toFixed(2);
        $("#txtMap").val(mapVal);
    });
    //计算休克指数
    $("#txtpssyVal,#txtpmbVal").on("blur", function () {
        var float2regex = /^\d+(\.\d{0,2})?$/;
        var pssyVal = $("#txtpssyVal").val();
        var pmbVal = $("#txtpmbVal").val();
        if (!float2regex.test(pssyVal)) return;
        if (!float2regex.test(pmbVal)) return;
        //计算休克指数
        var ssy = parseFloat(pssyVal);
        var mb = parseFloat(pmbVal);
        if (mb == 0) return;
        var shockIndex = (mb / ssy).toFixed(1);
        $("#txtshock").val(shockIndex);
    });
    $('input[name="rdocomeinisGcs"]').click(function () {
        if ($("input[name='rdocomeinisGcs']:checked").val() == 1) {
            $("#rdocomeinisGcsYes").show();
        } else {
            $("#rdocomeinisGcsYes").hide();
        }
    });
    $('input[name="rdoishavecttime"]').click(function () {
        if ($("input[name='rdoishavecttime']:checked").val() == 1) {
            $("#rdoishavecttimeYes").show();
            $("#rdoishavecttimeYes2").show();
        } else {
            $("#rdoishavecttimeYes").hide();
            $("#rdoishavecttimeYes2").hide();
        }
    });
    $('input[name="rdoisCT"]').click(function () {
        if ($("input[name='rdoisCT']:checked").val() == 1) {
            $("#rdoisCTYes").show();
            $("#rdoisCTYes2").show();
        } else {
            $("#rdoisCTYes").hide();
            $("#rdoisCTYes2").hide();
        }
    });
    $('input[name="rdoheadxline"]').click(function () {
        if ($("input[name='rdoheadxline']:checked").val() == 1) {
            $("#rdoheadxlineYes").show();
            $("#rdoheadxlineYes2").show();
        } else {
            $("#rdoheadxlineYes").hide();
            $("#rdoheadxlineYes2").hide();
        }
    });
    $('input[name="rdochestxline"]').click(function () {
        if ($("input[name='rdochestxline']:checked").val() == 1) {
            $("#rdochestxlineYes").show();
            $("#rdochestxlineYes2").show();
        } else {
            $("#rdochestxlineYes").hide();
            $("#rdochestxlineYes2").hide();
        }
    });
    $('input[name="rdoishaveecg"]').click(function () {
        if ($("input[name='rdoishaveecg']:checked").val() == 1) {
            $("#rdoishaveecgYes").show();
            $("#rdoishaveecgYes2").show();
        } else {
            $("#rdoishaveecgYes").hide();
            $("#rdoishaveecgYes2").hide();
        }
    });
    $('input[name="rdoishaveBmode"]').click(function () {
        if ($("input[name='rdoishaveBmode']:checked").val() == 1) {
            $("#rdoishaveBmodeYes").show();
            $("#rdoishaveBmodeYes2").show();
        } else {
            $("#rdoishaveBmodeYes").hide();
            $("#rdoishaveBmodeYes2").hide();
        }
    });
    $('input[name="rdoishavexqcc"]').click(function () {
        if ($("input[name='rdoishavexqcc']:checked").val() == 1) {
            $("#rdoishavexqccYes").show();
            $("#rdoishavexqccYes2").show();
        } else {
            $("#rdoishavexqccYes").hide();
            $("#rdoishavexqccYes2").hide();
        }
    });
    $('input[name="rdoishavefqcc"]').click(function () {
        if ($("input[name='rdoishavefqcc']:checked").val() == 1) {
            $("#rdoishavefqccYes").show();
            $("#rdoishavefqccYes2").show();
        } else {
            $("#rdoishavefqccYes").hide();
            $("#rdoishavefqccYes2").hide();
        }
    });
    $('input[name="rdodiagnosisOver"]').click(function () {
        if ($("input[name='rdodiagnosisOver']:checked").val() == 1) {
            $("#rdodiagnosisOverYes").show();
        } else {
            $("#rdodiagnosisOverYes").hide();
        }
    });
    $('input[name="rdolndmlheathisxj"]').click(function () {
        if ($("input[name='rdolndmlheathisxj']:checked").val() == 1) {
            $("#rdolndmlheathisxjYes").show();
        } else {
            $("#rdolndmlheathisxjYes").hide();
        }
    });
    $('input[name="rdoqgcgsj"]').click(function () {
        if ($("input[name='rdoqgcgsj']:checked").val() == 1) {
            $("#rdoqgcgsjYes").show();
        } else {
            $("#rdoqgcgsjYes").hide();
        }
    });
    $('input[name="rdoxqbsylsj"]').click(function () {
        if ($("input[name='rdoxqbsylsj']:checked").val() == 1) {
            $("#rdoxqbsylsjYes").show();
        } else {
            $("#rdoxqbsylsjYes").hide();
        }
    });
    $('input[name="rdobxsj"]').click(function () {
        if ($("input[name='rdobxsj']:checked").val() == 1) {
            $("#rdobxsjYes").show();
        } else {
            $("#rdobxsjYes").hide();
        }
    });
    $('input[name="rdosxsj"]').click(function () {
        if ($("input[name='rdosxsj']:checked").val() == 1) {
            $("#rdosxsjYes").show();
        } else {
            $("#rdosxsjYes").hide();
        }
    });
    $('input[name="rdojtgdsj"]').click(function () {
        if ($("input[name='rdojtgdsj']:checked").val() == 1) {
            $("#rdojtgdsjYes").show();
        } else {
            $("#rdojtgdsjYes").hide();
        }
    });
    $('input[name="rdoxdgdsj"]').click(function () {
        if ($("input[name='rdoxdgdsj']:checked").val() == 1) {
            $("#rdoxdgdsjYes").show();
        } else {
            $("#rdoxdgdsjYes").hide();
        }
    });
    $('input[name="rdogpgdsj"]').click(function () {
        if ($("input[name='rdogpgdsj']:checked").val() == 1) {
            $("#rdogpgdsjYes").show();
        } else {
            $("#rdogpgdsjYes").hide();
        }
    });
    $('input[name="rdoqyssj"]').click(function () {
        if ($("input[name='rdoqyssj']:checked").val() == 1) {
            $("#rdoqyssjYes").show();
        } else {
            $("#rdoqyssjYes").hide();
        }
    });
    $('input[name="rdolkqjssj"]').click(function () {
        if ($("input[name='rdolkqjssj']:checked").val() == 1) {
            $("#rdolkqjssjYes").show();
        } else {
            $("#rdolkqjssjYes").hide();
        }
    });
    $('input[name="rdolndmlexitPType"]').click(function () {
        if ($("input[name='rdolndmlexitPType']:checked").val() == 4) {
            $("#rdolndmlexitPTypeYes1,#rdolndmlexitPTypeYes2").show();
            if ($('#cbxlndmldieReason7').prop("checked")) {
                $("#divqitaswyy").show();
            } else {
                $("#divqitaswyy").hide();
            }
        } else {
            $("#rdolndmlexitPTypeYes1,#rdolndmlexitPTypeYes2,#divqitaswyy").hide();
        }
        if ($("input[name='rdolndmlexitPType']:checked").val() == 5) {
            $("#divlytypeother").show();
        } else {
            $("#divlytypeother").hide();
        }
    });
    $('#cbxlndmldieReason7').on("click", function () {
        if ($("#cbxlndmldieReason7").prop("checked") && $("#rdolndmlexitPType4").prop("checked")) {
            $("#divqitaswyy").show();
        } else {
            $("#divqitaswyy").hide();
        }
    })
    $('input[name="rdolndmlexitisGcs"]').click(function () {
        if ($("input[name='rdolndmlexitisGcs']:checked").val() == 1) {
            $("#rdolndmlexitisGcsYes").show();
        } else {
            $("#rdolndmlexitisGcsYes").hide();
        }
    });
    //单选框
    $("input[type=radio]").parent().addClass("radio_label");
    $("input[type=radio][disabled!=disabled]").click(function (e) {
        $("input[type=radio][name='" + $(this).attr('name') + "']").parent().removeClass("checked");
        $(this).parent().addClass("checked");
    });
    $("input[type=radio][checked=checked]").parent().addClass("checked");
    if (navigator.userAgent.indexOf("Firefox") > 0) { $(":radio,:checkbox").hide(); }
    //复选框	 
    $("input[type=checkbox]").parent().addClass("checkbox_label");
    $("input[type=checkbox][disabled!=disabled]").click(function (e) {
        if ($(this).parent().hasClass("checked"))
            $(this).parent().removeClass("checked");
        else
            $(this).parent().addClass("checked");
    });
    $("input[type=checkbox][checked=checked]").parent().addClass("checked");  
    $("#chkIsIDcard").click(function () {
        var isChecked = $(this).prop("checked");
        if (isChecked == "true") {
            $("#txtIDcard").blur();
        }
        else {
            $("#txtIDcard").focus();
        }
    })
    $("#chkIsGangAoTai").click(function () {
        var isChecked = $(this).prop("checked");
        if (isChecked == "true") {
            $("#txtGangAoTaiNum").blur();
        }
        else {
            $("#txtGangAoTaiNum").focus();
        }
    })
    $("#chkIsHuZhao").click(function () {
        var isChecked = $(this).prop("checked");
        if (isChecked == "true") {
            $("#txtHuZhao").blur();
        }
        else {
            $("#txtHuZhao").focus();
        }
    })
});
function PHIScore() {
    var score = 0;
    var Ssy = $('#txtpssyVal').val();
    if (Ssy == null || Ssy == "") {
        score += 0;
    }
    if (Ssy >= 100) {
        score += 0;
    }
    else if (Ssy >= 85 && Ssy < 100) {
        score += 1;
    }
    else if (Ssy >= 75 && Ssy < 85) {
        score += 3;
    }
    else if (Ssy < 75) {
        score += 5;
    }
    var Pulse = $('#txtpmbVal').val();
    if (Pulse == null || Pulse == "") {
        score += 0;
    }
    if (Pulse >= 51 && Pulse <= 119) {
        score += 0;
    }
    else if (Pulse > 120) {
        score += 3;
    }
    else if (Pulse < 50) {
        score += 5;
    }
    var Breath = $('#txtbreath').val();
    if (Breath >= 14 && Breath <= 28) {
        score += 0;
    }
    else if (Breath > 30) {
        score += 3;
    }
    else if (Breath < 10) {
        score += 5;
    }
    var Shenzhi = $('#hdncomeType').val();
    if (IsEmpty(Shenzhi)) {
        Shenzhi = 0;
    }
    score += parseInt(Shenzhi);
    var Chuantou = $('#ctncomeType').val();
    if (IsEmpty(Chuantou)) {
        Chuantou = 0;
    }
    score += parseInt(Chuantou);
    $("#txtPHI").val(score);
}
function GCSScore() {
    var score = 0;
    var ZhenYan = $('#zyncomeType').val();
    if (IsEmpty(ZhenYan)) {
        ZhenYan = 0;
    }
    score += parseInt(ZhenYan);
    var YanYu = $('#yyncomeType').val();
    if (IsEmpty(YanYu)) {
        YanYu = 0;
    }
    score += parseInt(YanYu);
    var YunDong = $('#ydncomeType').val();
    if (IsEmpty(YunDong)) {
        YunDong = 0;
    }
    score += parseInt(YunDong);
    $("#txtcomeinGcs").val(score);
    TSScore();
}
function TIScore() {
    var score = 0;
    var BuWei = $('#bwType').val();
    if (IsEmpty(BuWei)) {
        BuWei = 0;
    }
    score += parseInt(BuWei);
    var ChuangShang = $('#csType').val();
    if (IsEmpty(ChuangShang)) {
        ChuangShang = 0;
    }
    score += parseInt(ChuangShang);
    var XunHuan = $('#xhType').val();
    if (IsEmpty(XunHuan)) {
        XunHuan = 0;
    }
    score += parseInt(XunHuan);
    var YiShi = $('#ysType').val();
    if (IsEmpty(YiShi)) {
        YiShi = 0;
    }
    score += parseInt(YiShi);
    var HuXi = $('#hxType').val();
    if (IsEmpty(HuXi)) {
        HuXi = 0;
    }
    score += parseInt(HuXi);
    $("#txtTiScore").val(score);
}
function TSScore() {
    var score = 0;
    var hxfd = $('#hxfdType').val();
    if (IsEmpty(hxfd)) {
        hxfd = 0;
    }
    score += parseInt(hxfd);
    var mxxg = $('#mxxgType').val();
    if (IsEmpty(mxxg)) {
        mxxg = 0;
    }
    score += parseInt(mxxg);
    var hxpl = $('#txtbreath').val();
    if (IsEmpty(hxpl) || hxpl == 0) {
        score += 0;
    }
    else if (hxpl >= 1 && hxpl <= 9) {
        score += 1;
    }
    else if (hxpl > 35) {
        score += 2;
    }
    else if (hxpl >= 25 && hxpl <= 35) {
        score += 3;
    }
    else if (hxpl >= 10 && hxpl <= 24) {
        score += 4;
    }
    var dmssy = $('#txtpssyVal').val();
    if (IsEmpty(dmssy) || dmssy == 0) {
        score += 0;
    }
    else if (dmssy < 50 && dmssy != 0) {
        score += 1;
    }
    else if (dmssy >= 50 && dmssy <= 69) {
        score += 2;
    }
    else if (dmssy >= 70 && dmssy <= 89) {
        score += 3;
    }
    else if (dmssy >= 90) {
        score += 4;
    }
    var gcs = $('#txtcomeinGcs').val();
    if (IsEmpty(gcs) && gcs == 0) {
        score += 0;
    }
    else if (gcs >= 3 && gcs <= 4) {
        score += 1;
    }
    else if (gcs >= 5 && gcs <= 7) {
        score += 2;
    }
    else if (gcs >= 8 && gcs <= 10) {
        score += 3;
    }
    else if (gcs >= 11 && gcs <= 13) {
        score += 4;
    }
    else if (gcs >= 14 && gcs <= 15) {
        score += 5;
    }
    $("#txtTsScore").val(score);
}
function AISScore() {
    var score = 0;
    var tjb = $('#tjbType').val();
    if (IsEmpty(tjb)) {
        tjb = 0;
    }
    score += parseInt(tjb);
    var xb = $('#xbType').val();
    if (IsEmpty(xb)) {
        xb = 0;
    }
    score += parseInt(xb);
    var mb = $('#mbType').val();
    if (IsEmpty(mb)) {
        mb = 0;
    }
    score += parseInt(mb);
    var fb = $('#fbType').val();
    if (IsEmpty(fb)) {
        fb = 0;
    }
    score += parseInt(fb);
    var sz = $('#szType').val();
    if (IsEmpty(sz)) {
        sz = 0;
    }
    score += parseInt(sz);
    var tb = $('#tbType').val();
    if (IsEmpty(tb)) {
        tb = 0;
    }
    score += parseInt(tb);
    $("#txtAIS").val(score);
}
function ISSScore() {
    var score = 0;
    var arr = [$('#tjbType').val(), $('#xbType').val(), $('#mbType').val(), $('#fbType').val(), $('#szType').val(), $('#tbType').val()];
    arr = arr.sort().reverse();
    for (var i = 0; i < 3; i++) {
        if (arr[i] == 6) {
            return $("#txtISS").val(75);
        }
        score += arr[i] * arr[i];
    }
    $("#txtISS").val(score);
}
function position() {
    LiftEffect({
        "control1": ".lift-nav",
        "control2": ".lift",
        "target": [".t0", ".t1", ".t2", ".t3", ".t4", ".t5", ".t6"],
        "current": "current"
    });
}
function datetimedone(dateTimeInputId) {
    var chkId = $("#" + dateTimeInputId).attr("data-chkid");
    if (IsEmpty(chkId)) return;
    $("#" + chkId).removeAttr("checked");
    $("#" + chkId).parent().removeClass("checked");
    if (IsEmpty($("#" + dateTimeInputId).val())) return;
    $("#" + chkId).attr("checked", "checked");
    $("#" + chkId).parent().addClass("checked");
}
function printmr() {
    if ($("#txtrealName").val() == "") return;
    if ($("#txtPatientId").val() == "") return;
    window.parent.top.tab.addTabItem({ tabid: "print" + $("#txtPatientId").val(), text: "病历-" + $("#txtrealName").val(), url: "/TraumaCenter/MedicalRecords/TraumamrPrint?pid=" + $("#txtPatientId").val() });
}
function delmr() {
    if ($("#txtPatientId").val() == "") return;
    $.ligerDialog.confirm('确定删除该患者吗', function (yes) {
        if (!yes) return;
        var url = "/TraumaCenter/PatientList/GiveUp";
        $.get(url, {
            rnd: new Date().getMilliseconds(),
            patientId: $("#txtPatientId").val()
        }, function (data, textStatus) {
            if (textStatus == "success") {
                var d = $.parseJSON(data);
                if (d.Result == 1) {
                    $.ligerDialog.success("操作成功", "", function () {
                        window.location.href = "/TraumaCenter/MedicalRecords/index";
                    });
                }
                else if (d.Result == 0) {
                    $.ligerDialog.error(d.Body);
                }
                else {
                    $.ligerDialog.error("程序错误");
                }
            }
        })
    });
}
function savemr() {
    if ($("#txtPatientId").val() == "") return;
    var data = {};
    $.each(FiledArray, function (i, a) {
        var datadetail = {};
        $.each(a.column, function (j, b) {
            var str = "";
            if (b.type == "text" || b.type == 'date') {
                str = $('#' + b.code).val();
            } else if (b.type == "radio") {
                str = $("input[name='" + b.code + "']:checked").val();
            } else if (b.type == "checkbox") {
                str = CheckBoxToArrStr(b.code);
            } else if (b.type == "select") {
                str = $("#" + b.code).ligerGetComboBoxManager().getValue();
            }
            datadetail[b.tocode] = str == "" ? b.value : str;
        })
        data[a.table] = datadetail;
    })
    $.post("/TraumaCenter/MedicalRecords/SaveTraumamr", { datajson: JSON.stringify(data), rd: Math.random() }, function (data, textStatus) {
        if (textStatus == "success") {
            var d = $.parseJSON(data);
            if (d.Result == 1) {
                $.ligerDialog.success("保存成功", "", function () {
                    window.location.reload(true);
                });
            }
            else if (d.Result == 0) {
                $.ligerDialog.error(d.Body);
            }
            else {
                $.ligerDialog.error("程序错误");
            }
        }
    })
}
function SetValue() {
    var patientid = $('#txtPatientId').val();
    if (IsEmpty(patientid)) {
        $.ligerDialog.error("获取数据失败！");
        return;
    }
    waitting1 = $.ligerDialog.waitting('加载中，请稍候...');
    $.ajax({
        url: '/TraumaCenter/MedicalRecords/GetTraumamr?patientid=' + patientid + '&r=' + getRnd(),
        cache: false,
        dataType: 'json',
        success: function (data) {
            $.each(FiledArray, function (i, a) {
                var datadetail = eval("data." + a.table);
                if (datadetail != undefined && datadetail != null) {
                    $.each(a.column, function (j, b) {
                        if (b.type == "text") {
                            $('#' + b.code).val(eval("datadetail." + b.tocode));
                            $("input[name='" + b.code + "']").blur();
                        } else if (b.type == "date") {
                            $('#' + b.code).val(obj2Timemm(eval("datadetail." + b.tocode)));
                            $('#' + b.code).blur();
                        } else if (b.type == "radio") {
                            RadioSetVal(b.code, eval("datadetail." + b.tocode), true);
                            $("input[name='" + b.code + "'][value='" + eval("datadetail." + b.tocode) + "']").click();
                        } else if (b.type == "checkbox") {
                            CheckBoxSetVal(b.code, eval("datadetail." + b.tocode), true);
                        } else if (b.type = "select") {
                            $("#" + b.code).ligerGetComboBoxManager().setValue(eval("datadetail." + b.tocode));
                            $('#' + b.code).blur();
                        }
                    })
                    $("html,body").animate({ scrollTop: 0 }, 1);
                }
            })
            if (data.MR_EpiduralHematoma != null && data.MR_EpiduralHematoma.Hospital_Out_Type == 4 && data.MR_EpiduralHematoma.Hospital_Death_Why.toString().indexOf("7") >= 0) {
                //离院方式等于死亡 并且死亡原因有其他的时候
                $("#divqitaswyy").show();
            } else {
                $("#divqitaswyy").hide();
            }
            setTimeout(function () {
                BindSelectEvent()
            }, 1000);
        },
        complete: function () {
            waitting1.close();
        }
    });
}
function BindSelectEvent() {
    $("#txtpssyVal").blur(function () {
        PHIScore();
    })
    $("#txtpmbVal").blur(function () {
        PHIScore();
    })
    $("#txtbreath").blur(function () {
        PHIScore();
    })
    $("#txtbreath").blur(function () {
        TSScore();
    })
    $("#txtpssyVal").blur(function () {
        TSScore();
    })
    $("#txtcomeinGcs").blur(function () {
        TSScore();
    })
    $("#txtshenZhi").bind("change", function () {
        PHIScore();
    })
    $("#txtchuantou").bind("change", function () {
        PHIScore();
    })
    $("#txtzhenYan").bind("change", function () {
        GCSScore();
    })
    $("#txtyanYu").bind("change", function () {
        GCSScore();
    })
    $("#txtyunDong").bind("change", function () {
        GCSScore();
    })
    $("#txtbuWei").bind("change", function () {
        TIScore();
    })
    $("#txtChuangshang").bind("change", function () {
        TIScore();
    })
    $("#txtxunHuan").bind("change", function () {
        TIScore();
    })
    $("#txtyiShi").bind("change", function () {
        TIScore();
    })
    $("#txtHuxi").bind("change", function () {
        TIScore();
    })
    $("#txtHXFD").bind("change", function () {
        TSScore();
    })
    $("#txtMXXGCY").bind("change", function () {
        TSScore();
    })
    $("#txttjb").bind("change", function () {
        AISScore();
        ISSScore();
    })
    $("#txtxb").bind("change", function () {
        AISScore();
        ISSScore();
    })
    $("#txtmb").bind("change", function () {
        AISScore();
        ISSScore();
    })
    $("#txtfb").bind("change", function () {
        AISScore();
        ISSScore();
    })
    $("#txtsz").bind("change", function () {
        AISScore();
        ISSScore();
    })
    $("#txttb").bind("change", function () {
        AISScore();
        ISSScore();
    })
}
var FiledArray = [
{
    table: "patientInfo",
    column: [
        { name: "ID", code: "txtPIId", tocode: "ID", value: "0", type: "text" },
        { name: "姓名", code: "txtrealName", tocode: "PATIENT_NAME", value: "", type: "text" },
        { name: "性别", code: "rdogender", tocode: "PATIENT_SEX", value: "", type: "radio" },
        { name: "年龄", code: "txtage", tocode: "PATIENT_AGE", value: "", type: "text" },
        { name: "身份证", code: "txtIDcard", tocode: "PATIENT_ID_NUM", value: "", type: "text" },
        { name: "联系方式", code: "txtphone", tocode: "PATIENT_PHONE", value: "", type: "text" },
        { name: "门诊号", code: "txtPatientId", tocode: "PATIENT_ID", value: "", type: "text" },
        { name: "住址", code: "txtaddress", tocode: "PATIENT_ADDR", value: "", type: "text" },
        { name: "籍贯", code: "txtJiGuan", tocode: "Patient_NativePlace", value: "", type: "text" },
        { name: "港澳台证", code: "txtGangAoTaiNum", tocode: "Patient_HMTID_NUM", value: "", type: "text" },
        { name: "护照", code: "txtHuZhao", tocode: "Patient_Passport", value: "", type: "text" },
        { name: "来院方式", code: "rdocomeType", tocode: "PATIENT_ARRIVE_CLASS", value: "", type: "radio" }
    ]
},
    {
        table: "ambulanceInfo",
        column: [
            { name: "PATIENT_ID", code: "txtPatientId", tocode: "PATIENT_ID", value: "", type: "text" },
            { name: "ID", code: "txtAIId", tocode: "ID", value: "0", type: "text" },
            { name: "院内接诊时间", code: "txtmedicalTime", tocode: "EMS_ARRIVEDOOR_TIME", value: "", type: "date" },
            { name: "入院途径", code: "rdocomeinType", tocode: "AdmissionPath", value: "", type: "radio" }
        ]
    },
    {
        table: "MR_EpiduralHematoma",
        column: [
            { name: "Patient_ID", code: "txtPatientId", tocode: "Patient_ID", value: "", type: "text" },
            { name: "ID", code: "txtPCId", tocode: "ID", value: "0", type: "text" },
            { name: "药物过敏", code: "txtoutDrug", tocode: "Check_DrugAllergy_Name", value: "", type: "text" },
            { name: "首诊时间", code: "txtfirstHTime", tocode: "Check_FirstDiagnosis_Time", value: "", type: "date" },
            { name: "完成采血时间", code: "txtgetbloodTime", tocode: "Check_Blood_Time", value: "", type: "date" },
            { name: "头颅CT", code: "rdoishavecttime", tocode: "Check_HeadCT_Bool", value: "0", type: "radio" },
            { name: "头颅CT时间", code: "txtheadctTime", tocode: "Check_HeadCT_Time", value: "", type: "date" },
            { name: "头颅X线", code: "rdoheadxline", tocode: "Check_HeadX_Bool", value: "0", type: "radio" },
            { name: "头颅X线时间", code: "txtheadxlineTime", tocode: "Check_HeadX_Time", value: "", type: "date" },
            { name: "胸部X线", code: "rdochestxline", tocode: "Check_ChestX_Bool", value: "0", type: "radio" },
            { name: "胸部X线时间", code: "txtchestxlineTime", tocode: "Check_ChestX_Time", value: "", type: "date" },
            { name: "心电图", code: "rdoishaveecg", tocode: "Check_ECG_Bool", value: "0", type: "radio" },
            { name: "心电图时间", code: "txtecgTime", tocode: "Check_ECG_Time", value: "", type: "date" },
            { name: "B超", code: "rdoishaveBmode", tocode: "Check_BU_Bool", value: "0", type: "radio" },
            { name: "B超时间", code: "txtBmodeTime", tocode: "Check_BU_Time", value: "", type: "date" },
            { name: "诊断明确", code: "rdodiagnosisOver", tocode: "Check_DiagnosisInfor_Bool", value: "0", type: "radio" },
            { name: "明确时间", code: "txtdiagnosisOverTime", tocode: "Check_DiagnosisInfor_Time", value: "", type: "date" },
            { name: "幕上血肿量(ml)", code: "txtctupblood", tocode: "Check_CTMSXZL_Volume", value: "", type: "text" },
            { name: "幕下血肿量(ml)", code: "txtctdownblood", tocode: "Check_CTMXXZL_Volume", value: "", type: "text" },
            { name: "颞区血肿量(ml)", code: "txtctareablood", tocode: "Check_CTMQXZL_Volume", value: "", type: "text" },
            { name: "中线结构移位(cm)", code: "txtctcenterLine", tocode: "Check_CTZXJGWY_Distance", value: "", type: "text" },
            { name: "头颅骨折", code: "rdoheadfracture", tocode: "Check_SkullFracture_Type", value: "0", type: "radio" },
            { name: "肋骨骨折", code: "rdoribfracture", tocode: "Check_FracturedRibs_Type", value: "0", type: "radio" },
            { name: "心电图异常", code: "rdoishaveexcep", tocode: "Check_ECG_Type", value: "0", type: "radio" },
            { name: "胸腹腔积液(血)", code: "rdoishaveblood", tocode: "Check_BU_Type", value: "0", type: "radio" },
            { name: "到手术室时间", code: "txtarriveOpRoomTime", tocode: "Treatment_OperatingRoom_Time", value: "", type: "date" },
            { name: "麻醉时间", code: "txtanaesTime", tocode: "Treatment_Anesthesia_STime", value: "", type: "date" },
            { name: "手术时间", code: "txtdmlssopTime", tocode: "Treatment_Surgery_STime", value: "", type: "date" },
            { name: "手术结束时间", code: "txtdmlssopEndTime", tocode: "Treatment_Surgery_ETime", value: "", type: "date" },
            { name: "拆线时间", code: "txtbreaklineTime", tocode: "Treatment_RemoveLine_Time", value: "", type: "date" },
            { name: "接受康复治疗", code: "rdolndmliskfzl", tocode: "Rehabilitation_Treatment_Bool", value: "0", type: "radio" },
            { name: "康复治疗方式", code: "cbxlndmlkfzlType", tocode: "Rehabilitation_Treatment_Type", value: "", type: "checkbox" },
            { name: "康复治疗场所", code: "cbxlndmlkfzlAddr", tocode: "Rehabilitation_Treatment_Adress", value: "", type: "checkbox" },
            { name: "健康宣教", code: "rdolndmlheathisxj", tocode: "Health_Education_Bool", value: "0", type: "radio" },
            { name: "宣教方式", code: "cbxlndmlheathxjType", tocode: "Health_Education_Type", value: "", type: "checkbox" },
            { name: "出院时间", code: "txtlndmlexitPtime", tocode: "Hospital_Out_Time", value: "", type: "date" },
            { name: "离院方式", code: "rdolndmlexitPType", tocode: "Hospital_Out_Type", value: "0", type: "radio" },
            { name: "死亡时间", code: "txtlndmldieTime", tocode: "Hospital_Death_Time", value: "", type: "date" },
            { name: "死亡原因", code: "cbxlndmldieReason", tocode: "Hospital_Death_Why", value: "", type: "checkbox" },
            { name: "出院时GCS评分", code: "rdolndmlexitisGcs", tocode: "Hospital_GCS_Bool", value: "0", type: "radio" },
            { name: "评分", code: "txtlndmlexitGcs", tocode: "Hospital_GCS_Score", value: "", type: "text" },
            { name: "出院带药", code: "cbxlndmlexitpwithy", tocode: "Hospital_Drug_Bool", value: "", type: "checkbox" },
            { name: "血糖", code: "txtXueTang", tocode: "Hospital_BloodSugar_Num", value: "", type: "text" },
            { name: "TI评分", code: "txtTiScore", tocode: "Hospital_TI_Score", value: "", type: "text" },
            { name: "TS评分", code: "txtTsScore", tocode: "Hospital_TS_Score", value: "", type: "text" },
            { name: "红细胞", code: "txtRBC", tocode: "Check_RedCells_Num", value: "", type: "text" },
            { name: "血红蛋白", code: "txtHB", tocode: "Check_Hemoglobin_Num", value: "", type: "text" },
            { name: "红细胞压积", code: "txtHCT", tocode: "Check_RedCellsDeposited_Num", value: "", type: "text" },
            { name: "白细胞", code: "txtWBC", tocode: "Check_WhiteCells_Num", value: "", type: "text" },
            { name: "中性粒细胞", code: "txtNEUT", tocode: "Check_Neutrophils_Num", value: "", type: "text" },
            { name: "血小板", code: "txtPLT", tocode: "Check_Platelet_Num", value: "", type: "text" },
            { name: "凝血酶时间", code: "txtNXHYSJ", tocode: "Check_Thrombin_Time", value: "", type: "text" },
            { name: "活化部分凝血活酶时间", code: "txtHHBFNXHMSJ", tocode: "Check_PartThrombin_Time", value: "", type: "text" },
            { name: "D-二聚体", code: "txtDEJT", tocode: "Check_Dimer_Num", value: "", type: "text" },
            { name: "PT活动度", code: "txtPTHDD", tocode: "Check_PT_Num", value: "", type: "text" },
            { name: "纤维蛋白原", code: "txtXWDBY", tocode: "Check_Fibrinogen_Num", value: "", type: "text" },
            { name: "凝血酶时间", code: "txtNXMSJ", tocode: "Check_ThrombinOld_Time", value: "", type: "text" },
            { name: "乙肝", code: "rdoYiGan", tocode: "Check_HepatitisB_bool", value: "0", type: "radio" },
            { name: "丙肝", code: "rdoBingGan", tocode: "Check_HepatitisC_bool", value: "0", type: "radio" },
            { name: "戊肝", code: "rdoWuGan", tocode: "Check_HepatitisE_bool", value: "0", type: "radio" },
            { name: "血型", code: "rdoBloodType", tocode: "Check_ABO_bool", value: "0", type: "radio" },
            { name: "RH", code: "rdobloodRh", tocode: "Check_RH_bool", value: "0", type: "radio" },
            { name: "HIV", code: "rdoHIV", tocode: "Check_Hiv_bool", value: "0", type: "radio" },
            { name: "TP", code: "rdoTP", tocode: "Check_TP_bool", value: "0", type: "radio" },
            { name: "心电图报告结果", code: "txtecgResult", tocode: "Check_ECG_Conclusion", value: "", type: "text" },
            { name: "X线", code: "rdoishavexxian", tocode: "Check_X_Bool", value: "0", type: "radio" },
            { name: "X线时间", code: "txtxxianTime", tocode: "Check_X_Time", value: "", type: "date" },
            { name: "X线报告结果", code: "txtxxianResult", tocode: "Check_X_Conclusion", value: "", type: "text" },
            { name: "B超报告结果", code: "txtBmodeResult", tocode: "Check_BU_Conclusion", value: "", type: "text" },
            { name: "CT", code: "rdoisCT", tocode: "Check_CT_Bool", value: "0", type: "radio" },
            { name: "CT时间", code: "txtCTTime", tocode: "Check_CT_Time", value: "", type: "date" },
            { name: "CT报告结果", code: "txtCTResult", tocode: "Check_CT_Conclusion", value: "", type: "text" },
            { name: "胸腔穿刺", code: "rdoishavexqcc", tocode: "Check_PleuralPuncture_Bool", value: "0", type: "radio" },
            { name: "胸腔穿刺时间", code: "txtXQCCTime", tocode: "Check_PleuralPuncture_Time", value: "", type: "date" },
            { name: "胸腔穿刺报告结果", code: "txtXQCCResult", tocode: "Check_PleuralPuncture_Conclusion", value: "", type: "text" },
            { name: "腹腔穿刺", code: "rdoishavefqcc", tocode: "Check_AbdominalPuncture_Bool", value: "0", type: "radio" },
            { name: "腹腔穿刺时间", code: "txtFQCCTime", tocode: "Check_AbdominalPuncture_Time", value: "", type: "date" },
            { name: "腹腔穿刺报告结果", code: "txtFQCCResult", tocode: "Check_AbdominalPuncture_Conclusion", value: "", type: "text" },
            { name: "初步诊断", code: "txtCBZD", tocode: "Check_PrimaryDiagnosis_Conclusion", value: "", type: "text" },
            { name: "AIS评分", code: "txtAIS", tocode: "Check_AIS_Score", value: "", type: "text" },
            { name: "ISS评分", code: "txtISS", tocode: "Check_ISS_Score", value: "", type: "text" },
            { name: "手术次数", code: "txtshoushucishu", tocode: "Hospital_Surgery_Num", value: "", type: "text" },
            { name: "抢救室滞留时间", code: "txtqjszlsj", tocode: "Hospital_Stranded_Lenght", value: "", type: "text" },
            { name: "重症监护室", code: "rdozzjhs", tocode: "Hospital_ICU_Bool", value: "", type: "radio" },
            { name: "重症监护室天数", code: "txtzzjhsdays", tocode: "Hospital_ICU_Day", value: "", type: "text" },
            { name: "呼吸机应用", code: "rdohuxijiyingyong", tocode: "Hospital_BreathingMachine_Bool", value: "", type: "radio" },
            { name: "呼吸机应用天数", code: "txthxjyydays", tocode: "Hospital_BreathingMachine_Day", value: "", type: "text" },
            { name: "离院方式其他", code: "txtHospOutTypeOther", tocode: "Hospital_Out_TypeOther", value: "", type: "text" },
            { name: "申请输血时间", code: "txtsqsxTime", tocode: "Treatment_ApplyBlood_Time", value: "", type: "date" },
            { name: "开始输血时间", code: "txtkssxTime", tocode: "Treatment_StartBlood_Time", value: "", type: "date" },
            { name: "手术名称", code: "txtssmc", tocode: "Treatment_Name", value: "0", type: "text" },
            { name: "手术分级", code: "rdoshoushufenji", tocode: "Treatment_LV", value: "0", type: "radio" },
            { name: "术后去向", code: "txtshqx", tocode: "Treatment_To", value: "", type: "text" },
            //{ name: "气管插管", code: "rdoqgcgsj", tocode: "", value: "0", type: "radio" },
            { name: "气管插管时间", code: "txtqgcgTime", tocode: "TreatmentU_QGCG_Time", value: "", type: "date" },
            //{ name: "胸腔闭式引流", code: "rdoxqbsylsj", tocode: "", value: "0", type: "radio" },
            { name: "胸腔闭式引流时间", code: "txtxqbsylTime", tocode: "TreatmentU_XQBSYL_Time", value: "", type: "date" },
            //{ name: "备血", code: "rdobxsj", tocode: "", value: "0", type: "radio" },
            { name: "备血时间", code: "txtbxTime", tocode: "TreatmentU_BX_Time", value: "", type: "date" },
            //{ name: "输血", code: "rdosxsj", tocode: "", value: "0", type: "radio" },
            { name: "输血时间", code: "txtsxTime", tocode: "TreatmentU_SX_Time", value: "", type: "date" },
            //{ name: "颈托固定", code: "rdojtgdsj", tocode: "", value: "0", type: "radio" },
            { name: "颈托固定时间", code: "txtjtgdTime", tocode: "TreatmentU_JTGD_Time", value: "", type: "date" },
            //{ name: "胸带固定", code: "rdoxdgdsj", tocode: "", value: "0", type: "radio" },
            { name: "胸带固定时间", code: "txtxdgdTime", tocode: "TreatmentU_XDGD_Time", value: "", type: "date" },
            //{ name: "骨盆固定", code: "rdogpgdsj", tocode: "", value: "0", type: "radio" },
            { name: "骨盆固定时间", code: "txtgpgdTime", tocode: "TreatmentU_GPGD_Time", value: "", type: "date" },
            //{ name: "牵引术", code: "rdoqyssj", tocode: "", value: "0", type: "radio" },
            { name: "牵引术时间", code: "txtqysTime", tocode: "TreatmentU_QYS_Time", value: "", type: "date" },
            //{ name: "离开抢救室", code: "rdolkqjssj", tocode: "", value: "0", type: "radio" },
            { name: "离开抢救室时间", code: "txtlkqjsTime", tocode: "TreatmentU_LKQJS_Time", value: "", type: "date" },
            { name: "非手术治疗其他", code: "txtfsszlOther", tocode: "TreatmentU_Other", value: "", type: "text" },
            { name: "其他死亡原因", code: "txtqitasiwangyy", tocode: "Hospital_Death_WhyOther", value: "", type: "text" },
            { name: "神志", code: "txtshenZhi", tocode: "PHI_Consciousness_Int", value: "", type: "select" },
            { name: "有无胸或腹部穿透伤", code: "txtchuantou", tocode: "PHI_WoundType_Int", value: "", type: "select" },
            { name: "睁眼反应", code: "txtzhenYan", tocode: "GCS_OpenEye_State", value: "", type: "select" },
            { name: "言语反应", code: "txtyanYu", tocode: "GCS_Speak_State", value: "", type: "select" },
            { name: "运动反应", code: "txtyunDong", tocode: "GCS_Sport_State", value: "", type: "select" },
            { name: "创伤指数  部位", code: "txtbuWei", tocode: "TI_Parts_Location", value: "", type: "select" },
            { name: "创伤类型", code: "txtChuangshang", tocode: "TI_Trauma_Type", value: "", type: "select" },
            { name: "循环类型", code: "txtxunHuan", tocode: "TI_Cycle_Type", value: "", type: "select" },
            { name: "意识", code: "txtyiShi", tocode: "TI_Consciousness_Int", value: "", type: "select" },
            { name: "呼吸", code: "txtHuxi", tocode: "TI_Breathing_Int", value: "", type: "select" },
            { name: "呼吸幅度", code: "txtHXFD", tocode: "TS_BreathingAmplitude_Int", value: "", type: "select" },
            { name: "毛细血管充盈", code: "txtMXXGCY", tocode: "TS_CapillaryFilling_Int", value: "", type: "select" },
            { name: "头颈部AIS评分", code: "txttjb", tocode: "AIS_Head_Score", value: "", type: "select" },
            { name: "胸部AIS评分", code: "txtxb", tocode: "AIS_Chest_Score", value: "", type: "select" },
            { name: "脸部Ais评分", code: "txtmb", tocode: "AIS_Face_Score", value: "", type: "select" },
            { name: "腹部及盆腔AIS评分", code: "txtfb", tocode: "AIS_Abdomen_Score", value: "", type: "select" },
            { name: "四肢及骨盆AIS评分", code: "txtsz", tocode: "AIS_Llimbs_Score", value: "", type: "select" },
            { name: "体表AIS评分", code: "txttb", tocode: "AIS_Body_Score", value: "", type: "select" }
        ]
    },
    {
        table: "patientSigns",
        column: [
            { name: "PATIENT_ID", code: "txtPatientId", tocode: "PATIENT_ID", value: "", type: "text" },
            { name: "ID", code: "txtPSId", tocode: "PATIENT_SIGNS_ID", value: "0", type: "text" },
            { name: "民族", code: "txtethnic", tocode: "Patient_National", value: "", type: "text" },
            { name: "BMI(kg/㎡)", code: "txtbmiVal", tocode: "Patient_BMI", value: "", type: "text" },
            { name: "脉搏(次/分)", code: "txtpmbVal", tocode: "PATIENT_HEART", value: "", type: "text" },
            { name: "收缩压(mmHg)", code: "txtpssyVal", tocode: "PATIENT_BLOOD_H", value: "", type: "text" },
            { name: "舒张压(mmHg)", code: "txtpszyVal", tocode: "PATIENT_BLOOD_L", value: "", type: "text" },
            { name: "身高(cm)", code: "txtpheigh", tocode: "Patient_Height", value: "", type: "text" },
            { name: "体重(kg)", code: "txtpweight", tocode: "Patient_Weight", value: "", type: "text" },
            { name: "呼吸", code: "txtbreath", tocode: "PATIENT_BREATHE", value: "", type: "text" },
            { name: "体温", code: "txttemperature", tocode: "PATIENT_TEMPERATURE", value: "", type: "text" },
            { name: "休克指数", code: "txtshock", tocode: "Patient_ShockIndex", value: "", type: "text" },
            { name: "GCS评分", code: "rdocomeinisGcs", tocode: "Assessment_GCS_Bool", value: "0", type: "radio" },
            { name: "评分分数", code: "txtcomeinGcs", tocode: "Assessment_GCS_Score", value: "", type: "text" },
            { name: "是否脑疝", code: "rdocomeinisNs", tocode: "Assessment_CerebralHernia_Bool", value: "0", type: "radio" },
            { name: "PHI", code: "txtPHI", tocode: "Basic_PHI_Score", value: "", type: "text" },
            { name: "PHI预警", code: "rdoPhiRes", tocode: "Basic_Warning_Score", value: "0", type: "radio" }
        ]
    }
]